.container{
  display: flex;

  flex-wrap: wrap;
  align-content: stretch;

  width: 300px;
  height: 300px;
  border: 1px solid red;
}

.container span{
  width: 50px;
  /*min-height: 50px;*/
  margin: 5px;
  background: linear-gradient(blue, yellow);
}
